"use strict";(self.webpackChunkpeaches=self.webpackChunkpeaches||[]).push([[5223],{4434:function(t,e,s){s.d(e,{$:function(){return a}});var r=s(14181),i=s(78852),n=s(48241),u=s(92127),h=s(81089),a=class extends u.Q{constructor(t,e){super(),this.#t=void 0,this.#e=void 0,this.#s=void 0,this.#r=new Set,this.#i=t,this.options=e,this.#n=null,this.bindMethods(),this.setOptions(e)}#i;#t;#e;#s;#u;#h;#n;#a;#o;#c;#l;#d;#p;#r;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#t.addObserver(this),shouldFetchOnMount(this.#t,this.options)?this.#f():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#R(),this.#v(),this.#t.removeObserver(this)}setOptions(t,e){let s=this.options,i=this.#t;if(this.options=this.#i.defaultQueryOptions(t),(0,r.f8)(s,this.options)||this.#i.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.#Q();let n=this.hasListeners();n&&shouldFetchOptionally(this.#t,i,this.options,s)&&this.#f(),this.updateResult(e),n&&(this.#t!==i||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.#O();let u=this.#b();n&&(this.#t!==i||this.options.enabled!==s.enabled||u!==this.#p)&&this.#m(u)}getOptimisticResult(t){let e=this.#i.getQueryCache().build(this.#i,t),s=this.createResult(e,t);return(0,r.f8)(this.getCurrentResult(),s)||(this.#s=s,this.#h=this.options,this.#u=this.#t.state),s}getCurrentResult(){return this.#s}trackResult(t){let e={};return Object.keys(t).forEach(s=>{Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:()=>(this.#r.add(s),t[s])})}),e}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#i.defaultQueryOptions(t),s=this.#i.getQueryCache().build(this.#i,e);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#f({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#f(t){this.#Q();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(r.lQ)),e}#O(){if(this.#R(),r.S$||this.#s.isStale||!(0,r.gn)(this.options.staleTime))return;let t=(0,r.j3)(this.#s.dataUpdatedAt,this.options.staleTime);this.#l=setTimeout(()=>{this.#s.isStale||this.updateResult()},t+1)}#b(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#m(t){this.#v(),this.#p=t,!r.S$&&!1!==this.options.enabled&&(0,r.gn)(this.#p)&&0!==this.#p&&(this.#d=setInterval(()=>{(this.options.refetchIntervalInBackground||n.m.isFocused())&&this.#f()},this.#p))}#y(){this.#O(),this.#m(this.#b())}#R(){this.#l&&(clearTimeout(this.#l),this.#l=void 0)}#v(){this.#d&&(clearInterval(this.#d),this.#d=void 0)}createResult(t,e){let s;let i=this.#t,n=this.options,u=this.#s,a=this.#u,o=this.#h,c=t!==i,l=c?t.state:this.#e,{state:d}=t,{error:p,errorUpdatedAt:f,fetchStatus:y,status:R}=d,v=!1;if(e._optimisticResults){let s=this.hasListeners(),r=!s&&shouldFetchOnMount(t,e),u=s&&shouldFetchOptionally(t,i,e,n);(r||u)&&(y=(0,h.v_)(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(R="pending")),"isRestoring"===e._optimisticResults&&(y="idle")}if(e.select&&void 0!==d.data){if(u&&d.data===a?.data&&e.select===this.#a)s=this.#o;else try{this.#a=e.select,s=e.select(d.data),s=(0,r.pl)(u?.data,s,e),this.#o=s,this.#n=null}catch(t){this.#n=t}}else s=d.data;if(void 0!==e.placeholderData&&void 0===s&&"pending"===R){let t;if(u?.isPlaceholderData&&e.placeholderData===o?.placeholderData)t=u.data;else if(t="function"==typeof e.placeholderData?e.placeholderData(this.#c?.state.data,this.#c):e.placeholderData,e.select&&void 0!==t)try{t=e.select(t),this.#n=null}catch(t){this.#n=t}void 0!==t&&(R="success",s=(0,r.pl)(u?.data,t,e),v=!0)}this.#n&&(p=this.#n,s=this.#o,f=Date.now(),R="error");let Q="fetching"===y,O="pending"===R,b="error"===R,m=O&&Q,I={status:R,fetchStatus:y,isPending:O,isSuccess:"success"===R,isError:b,isInitialLoading:m,isLoading:m,data:s,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:f,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:Q,isRefetching:Q&&!O,isLoadingError:b&&0===d.dataUpdatedAt,isPaused:"paused"===y,isPlaceholderData:v,isRefetchError:b&&0!==d.dataUpdatedAt,isStale:isStale(t,e),refetch:this.refetch};return I}updateResult(t){let e=this.#s,s=this.createResult(this.#t,this.options);if(this.#u=this.#t.state,this.#h=this.options,void 0!==this.#u.data&&(this.#c=this.#t),(0,r.f8)(s,e))return;this.#s=s;let i={};t?.listeners!==!1&&(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#r.size)return!0;let r=new Set(s??this.#r);return this.options.throwOnError&&r.add("error"),Object.keys(this.#s).some(t=>{let s=this.#s[t]!==e[t];return s&&r.has(t)})})()&&(i.listeners=!0),this.#I({...i,...t})}#Q(){let t=this.#i.getQueryCache().build(this.#i,this.options);if(t===this.#t)return;let e=this.#t;this.#t=t,this.#e=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#I(t){i.j.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#i.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function shouldFetchOnMount(t,e){return!1!==e.enabled&&!t.state.dataUpdatedAt&&!("error"===t.state.status&&!1===e.retryOnMount)||t.state.dataUpdatedAt>0&&shouldFetchOn(t,e,e.refetchOnMount)}function shouldFetchOn(t,e,s){if(!1!==e.enabled){let r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&isStale(t,e)}return!1}function shouldFetchOptionally(t,e,s,r){return!1!==s.enabled&&(t!==e||!1===r.enabled)&&(!s.suspense||"error"!==t.state.status)&&isStale(t,s)}function isStale(t,e){return t.isStaleByTime(e.staleTime)}},10700:function(t,e,s){let r;s.d(e,{t:function(){return useBaseQuery}});var i=s(77059),n=s(78852),u=i.createContext((r=!1,{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r})),useQueryErrorResetBoundary=()=>i.useContext(u),h=s(93402),a=i.createContext(!1),useIsRestoring=()=>i.useContext(a);a.Provider;var o=s(9873),ensurePreventErrorBoundaryRetry=(t,e)=>{(t.suspense||t.throwOnError)&&!e.isReset()&&(t.retryOnMount=!1)},useClearResetErrorBoundary=t=>{i.useEffect(()=>{t.clearReset()},[t])},getHasError=({result:t,errorResetBoundary:e,throwOnError:s,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&(0,o.G)(s,[t.error,r]),ensureStaleTime=t=>{t.suspense&&"number"!=typeof t.staleTime&&(t.staleTime=1e3)},shouldSuspend=(t,e)=>t?.suspense&&e.isPending,fetchOptimistic=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function useBaseQuery(t,e,s){let r=(0,h.jE)(s),u=useIsRestoring(),a=useQueryErrorResetBoundary(),o=r.defaultQueryOptions(t);o._optimisticResults=u?"isRestoring":"optimistic",ensureStaleTime(o),ensurePreventErrorBoundaryRetry(o,a),useClearResetErrorBoundary(a);let[c]=i.useState(()=>new e(r,o)),l=c.getOptimisticResult(o);if(i.useSyncExternalStore(i.useCallback(t=>{let e=u?()=>void 0:c.subscribe(n.j.batchCalls(t));return c.updateResult(),e},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),i.useEffect(()=>{c.setOptions(o,{listeners:!1})},[o,c]),shouldSuspend(o,l))throw c.setOptions(o,{listeners:!1}),fetchOptimistic(o,c,a);if(getHasError({result:l,errorResetBoundary:a,throwOnError:o.throwOnError,query:c.getCurrentQuery()}))throw l.error;return o.notifyOnChangeProps?l:c.trackResult(l)}},35223:function(t,e,s){s.d(e,{I:function(){return useQuery}});var r=s(4434),i=s(10700);function useQuery(t,e){return(0,i.t)(t,r.$,e)}}}]);